package LYL.ynny.domo02;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public abstract class ErHashMap {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            // 添加省份和城市数据
            HashMap<String, ArrayList<String>> HashMap = new HashMap<>();


            ArrayList<String> yunnanCities = new ArrayList<>();
            yunnanCities.add("昭通，曲靖，保山，玉溪，临沧，丽江，普洱");
            // 打印云南省内的市名
            HashMap.put("云南省", yunnanCities);

            ArrayList<String> guangdongCities = new ArrayList<>();
            guangdongCities.add("深圳，广州，珠海，汕头，韶关，佛山，江门，湛江，茂名，肇庆，惠州，梅州，汕尾，河源，阳江，清远，东莞，中山，潮州");
            HashMap.put("广东省", guangdongCities);

            ArrayList<String> jiangsuCities = new ArrayList<>();
            jiangsuCities.add("南京，苏州，无锡，常州，镇江，南通，泰州，扬州，盐城，连云港，徐州，淮安");
            HashMap.put("江苏省", jiangsuCities);

            ArrayList<String> jiangxiCities = new ArrayList<>();
            jiangxiCities.add("南昌，景德镇，萍乡，九江，新余，鹰潭，赣州，吉安，抚州，上饶");
            HashMap.put("江西省", jiangxiCities);

            String province = sc.next();

            if (province.equals("退出")) {
                break;
            } else {
                ArrayList<String> cities = HashMap.get(province);
                if (cities != null) {
                    System.out.println(province + "的市名有：" + cities);
                } else {
                    System.out.println("没有这个省份");
                }
            }
        }
    }
}
